<?php

namespace app\model;

use think\Model;

class Disease extends Model
{
    const IS_DELETE_NO = 0;

    /**
     * @Description
     * @author: zj
     * @param int $factoryId
     * @param int $outId
     * @time 2024/03/12 16:12:18
     * @return mixed|null
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function checkOutIdIsExist(int $factoryId, int $outId)
    {
        $info = $this->field('id')
            ->where('factory_id', $factoryId)
            ->where('out_id', $outId)
            ->where('delete_time', self::IS_DELETE_NO)
            ->find();
        if (!$info) {
            return null;
        }

        return $info['id'];
    }


}